import App from './App'
import uvUI from '@/uni_modules/uv-ui-tools'
import { CONFIG } from '@/utils/request'
import api from '@/api'
import store from './stores'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'

Vue.prototype.$store = store
Vue.prototype.$api = api
Vue.prototype.$baseFileUrl = CONFIG.uploadFileUrl
Vue.prototype.$appName = '恒源水务模板App'

Vue.use(uvUI);

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'

export function createApp() {
  const app = createSSRApp(App)
  
  // 配置全局变量 页面中使用 inject 接收
  app.provide('global',{
    appName: '恒源水务模板App',
    baseFileUrl: CONFIG.uploadFileUrl,
	api: api
  })


  app.use(uvUI);
  app.use(store);
  
  return {
    app
  }
}
// #endif